<?php

namespace App\Modules\Rebate\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class rebate
 * @package App\Modules\rebate\Models
 * @property int $shop_id
 * @property int $user_id
 * @property string $title
 * @property string $origin
 * @property int $link_id
 * @property int $buyer_id
 * @property int $money
 * @property int $price
 * @property string $status
 * @property integer $level
 * @property integer $has_orders
 */
class Rebate extends Model
{
    use SoftDeletes;

    const STATUS_INIT   = 'init';
    const STATUS_ISSUED = 'issued';
    const STATUS_FAIL   = 'fail';
    const STATUS_FINISH = 'finish';

    const WITHDRAWAL_STATUS_PENDING = 'pending';
    const WITHDRAWAL_STATUS_SUCCESS = 'success';
    const WITHDRAWAL_STATUS_FAIL    = 'fail';

    public static $statusShow = [
        self::STATUS_INIT   => "待发放",
        self::STATUS_ISSUED => "可提现",
        self::STATUS_FAIL   => "未通过",
        self::STATUS_FINISH => "提现中",
    ];

    public static $withdrawalStatusShow = [
        self::WITHDRAWAL_STATUS_PENDING => "提现中",
        self::WITHDRAWAL_STATUS_SUCCESS => "已提现",
        self::WITHDRAWAL_STATUS_FAIL    => "提现未通过",
    ];

    protected $fillable = [
        "shop_id",
        "user_id",
        "title",
        "origin",
        "link_id",
        "buyer_id",
        "money",
        "price",
        "status",
        "level",
        "withdrawal_status",
        "reject_reason",//驳回原因
        'revoke_time',//撤回操作时间
        'revoke_admin_id',//撤回操作管理员id
        'withdrawal_type',//提现方式0=立即提现，1=稍后提现
        'withdrawal_time',//提现时间，即用户个人中心提现记录可以展示的时间
    ];
}
